import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { UserService } from '../../services/user.service';
import { User } from '../../entity/User';

@Component({
  selector: 'app-question',
  templateUrl: './question.component.html',
  styleUrls: ['./question.component.css']
})
export class QuestionComponent implements OnInit {
  _displayData = [];
  user: User;
  data = [];
  constructor(private http: HttpClient
    , private userService: UserService) {
  }

  ngOnInit() {
    this.user = this.userService.getUser();
    this.http
      .get(`/api/Questions/getAll`)
      .subscribe(response => {
        this.data = response as Array<any>;
      });
  }
}
